﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DataAccess;

namespace Business {
    /// <summary>
    /// 
    /// </summary>
    public class CreateConn {
        CreateConnection objcon = new CreateConnection();
        /// <summary>
        /// SQLs the conn data set.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <returns></returns>
     /*   public DataSet SQLConnDataSet(string query) {
            DataSet ds = objcon.CreateDataSet(query);
            return ds;
        }*/
        /// <summary>
        /// SQLs the conn data table.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <returns></returns>
        public DataTable SQLConnDataTable(string query) {
            DataTable dt = objcon.CreateDataTable(query);
            return dt;
        }
        /// <summary>
        /// SQLs the CMD.
        /// </summary>
        /// <param name="query">The query.</param>
        public void SQLCmd(string query) {
            try {
                objcon.RunCommand(query);
            } catch (Exception err) {
                Console.Write("Err msg:" + err.Message);
            }
        }
        /// <summary>
        /// SQLs the stored procedure.
        /// </summary>
        /// <param name="storedProcedure">The stored procedure.</param>
        /// <returns></returns>
        public SqlCommand SQLStoredProcedure(string storedProcedure) {
            SqlCommand cmd = new SqlCommand();
            try {
                cmd = objcon.RunStoreProcedure(storedProcedure);

            } catch (Exception err) {
                Console.Write("Err msg:" + err.Message);
            }
            return cmd;
        }
    }
}
